package com.framework.admin.schedule.entity;

import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 定时任务调度日志表 sys_job_log
 * // @TableName("sys_job_log")
 * @author ruoyi
 */
@Data
@Entity
@Table
@org.hibernate.annotations.Table(appliesTo = "sys_job_log", comment = "任务执行日志")
public class SysJobLog implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @Id
    private Long jobLogId;

    /**
     * 任务名称
     */
    @Column(columnDefinition = "varchar(50) COMMENT '任务名称'")
    private String jobName;

    /**
     * 任务组名
     */
    @Column(columnDefinition = "varchar(20) COMMENT '任务组名'")
    private String jobGroup;

    /**
     * 调用目标字符串
     */
    @Column(columnDefinition = "varchar(50) COMMENT '调用目标字符串'")
    private String invokeTarget;

    /**
     * 日志信息
     */
    @Column(columnDefinition = "varchar(50) COMMENT '日志信息'")
    private String jobMessage;

    /**
     * 执行状态（0正常 1失败）
     */
    @Column(columnDefinition = "varchar(1) COMMENT '执行状态'")
    private String status;

    /**
     * 异常信息
     */
    @Column(columnDefinition = "text COMMENT '异常信息'")
    private String exceptionInfo;

    /**
     * 开始时间
     */
    @Column(columnDefinition = "datetime COMMENT '开始时间'")
    private Date createTime;

    /**
     * 停止时间
     */
    @Column(columnDefinition = "datetime COMMENT '停止时间'")
    private Date stopTime;

    public Long getJobLogId() {
        return jobLogId;
    }

    public void setJobLogId(Long jobLogId) {
        this.jobLogId = jobLogId;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getInvokeTarget() {
        return invokeTarget;
    }

    public void setInvokeTarget(String invokeTarget) {
        this.invokeTarget = invokeTarget;
    }

    public String getJobMessage() {
        return jobMessage;
    }

    public void setJobMessage(String jobMessage) {
        this.jobMessage = jobMessage;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getExceptionInfo() {
        return exceptionInfo;
    }

    public void setExceptionInfo(String exceptionInfo) {
        this.exceptionInfo = exceptionInfo;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getStopTime() {
        return stopTime;
    }

    public void setStopTime(Date stopTime) {
        this.stopTime = stopTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("jobLogId", getJobLogId())
                .append("jobName", getJobName())
                .append("jobGroup", getJobGroup())
                .append("jobMessage", getJobMessage())
                .append("status", getStatus())
                .append("exceptionInfo", getExceptionInfo())
                .append("startTime", getCreateTime())
                .append("stopTime", getStopTime())
                .toString();
    }
}
